
t = {1, nil, 3, 4, nil, 5}

print("#t:", #t)
for i, v in ipairs(t) do
    print(i, v)
end


function fun(...)
    local arg = {...}
    print("#arg:", #arg)
    for i, v in ipairs(arg) do
        print(i, v)
    end
    print("---")
    for i = 1, #arg, 1 do
        print(i, arg[i])
    end

    local args = table.pack(...)
    print("table.pack n:", args.n)
    for i = 1, args.n, 1 do
        print(i, args[i])
    end

    print("---select---")
    print("select('#', ...):", select("#", ...))

    for i = 1, select("#",...) do
        print(i, select(i, ...))
    end
    
end

print("---fun---")
fun(1, 2, nil, 3, 4, 5)


function fun2(a)

    local t = {'b', 'c'}

    return a or table.unpack(t);
end
print("---or---")
print( fun2(1) )
print( fun2(nil) )


do
    local t = {'a', 1, }
    print("---t---")
    for i, v in ipairs(t) do
        print(i, v)
    end
end
